/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file    gpio.h
  * @brief   This file contains all the function prototypes for
  *          the gpio.c file
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2023 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __GPIO_H__
#define __GPIO_H__

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "main.h"

/* USER CODE BEGIN Includes */

/* USER CODE END Includes */

/* USER CODE BEGIN Private defines */

#define FET_A_L_PORT		C_LIN1_GPIO_Port//GPIOA
#define FET_B_L_PORT		C_LIN2_GPIO_Port//GPIOA
#define FET_C_L_PORT		C_LIN3_GPIO_Port//GPIOA
#define FET_A_H_PORT		C_HIN1_GPIO_Port//GPIOA
#define FET_B_H_PORT		C_HIN1_GPIO_Port//GPIOA
#define FET_C_H_PORT		C_HIN1_GPIO_Port//GPIOA

#define FET_A_L_PIN		C_LIN1_Pin
#define FET_B_L_PIN		C_LIN2_Pin
#define FET_C_L_PIN		C_LIN3_Pin
#define FET_A_H_PIN		C_HIN1_Pin
#define FET_B_H_PIN		C_HIN2_Pin
#define FET_C_H_PIN		C_HIN3_Pin

#define AL_ON			    FET_A_L_PIN
#define BL_ON			    FET_B_L_PIN
#define CL_ON			    FET_C_L_PIN
#define AL_OFF			  (FET_A_L_PIN<<16)
#define BL_OFF			  (FET_B_L_PIN<<16)
#define CL_OFF			  (FET_C_L_PIN<<16)

#define AH_ON			   FET_A_H_PIN
#define BH_ON			   FET_B_H_PIN
#define CH_ON			   FET_C_H_PIN
#define AH_OFF			 (FET_A_H_PIN<<16)
#define BH_OFF			 (FET_B_H_PIN<<16)
#define CH_OFF			 (FET_C_H_PIN<<16)








//GPIO 模式  设置为输出0
#define FET_A_L_OFF FET_A_L_PORT->BSRR = AL_OFF//GPIO AL OFF
#define FET_B_L_OFF FET_B_L_PORT->BSRR = BL_OFF//GPIO BL OFF
#define FET_C_L_OFF FET_C_L_PORT->BSRR = CL_OFF//GPIO CL OFF

#define FET_A_H_OFF FET_A_H_PORT->BSRR = AH_OFF//GPIO AH OFF
#define FET_B_H_OFF FET_B_H_PORT->BSRR = BH_OFF//GPIO BH OFF
#define FET_C_H_OFF FET_C_H_PORT->BSRR = CH_OFF//GPIO CH OFF

//GPIO 模式  设置为输出1
#define FET_A_L_ON FET_A_L_PORT->BSRR = AL_ON//GPIO AL ON
#define FET_B_L_ON FET_B_L_PORT->BSRR = BL_ON//GPIO BL ON
#define FET_C_L_ON FET_C_L_PORT->BSRR = CL_ON//GPIO CL ON

#define FET_A_H_ON FET_A_H_PORT->BSRR = AH_ON//GPIO AH ON
#define FET_B_H_ON FET_B_H_PORT->BSRR = BH_ON//GPIO BH ON
#define FET_C_H_ON FET_C_H_PORT->BSRR = CH_ON//GPIO CH ON






/* USER CODE END Private defines */

void MX_GPIO_Init(void);

/* USER CODE BEGIN Prototypes */

/* USER CODE END Prototypes */

#ifdef __cplusplus
}
#endif
#endif /*__ GPIO_H__ */

